<?php
require '../../packages/connect_database.php';
mysql_select_db("auction");
$img1Src = $_GET["src"];
$phone = $_GET["phone"];
$query = mysql_query("SELECT * FROM auction WHERE img1 = '{$img1Src}' AND phone = '{$_COOKIE["phone"]}'");
if(mysql_num_rows($query) > 0)
	mysql_query("DELETE FROM auction WHERE img1 = '{$img1Src}' AND phone = '{$_COOKIE["phone"]}'") or die(mysql_error());
unlink("../../img/" . $_COOKIE["phone"] . "/" . $img1Src);
if(is_dir("../../img/" . $_COOKIE["phone"]))
	rmdir("../../img/" . $_COOKIE["phone"]);
